package com.ucar.achievement.util;

import com.ucar.achievement.form.Pagination;
import com.ucar.achievement.model.*;
import org.springframework.stereotype.Component;

/**
 * Description: 订单业绩详情工具类<br/>
 * @version V1.0  by 石冬冬-Heil Hitler on  2017/5/31 13:39
 */
@Component
public final class AchievementDetailUtil {
    /**
     * 构建一个订单业绩详情VO对象
     * @param initCallback
     * @return
     */
    public final AchievementDetailVO buildVO(InitCallback initCallback){
        AchievementDetailVO achievementDetailVO = new AchievementDetailVO();
        achievementDetailVO.setAchievementVO(initCallback.getAchievementVO());
        achievementDetailVO.setAdjustListPagination(initCallback.getAdjustListPagination());
        achievementDetailVO.setPostListPagination(initCallback.getPostListPagination());
        achievementDetailVO.setPostSumVO(initCallback.getPostSumVO());
        achievementDetailVO.setAdjustSumVO(initCallback.getAdjustSumVO());
        return achievementDetailVO;
    }

    /**
     * 初始化回调函数
     */
    public interface InitCallback{
        /**
         * 订单业绩
         * @return
         */
        AchievementVO getAchievementVO();
        /**
         * 入账累计金额
         */
        AchievementPostSumVO getPostSumVO();
        /**
         * 调整累计金额
         */
        AchievementAdjustSumVO getAdjustSumVO();
        /**
         * 业绩调整列表分页对象
         */
        Pagination<AchAdjustmentVO> getAdjustListPagination();
        /**
         * 业绩入账明细分页对象
         */
        Pagination<AchievePostVO> getPostListPagination();
    }
}
